package cn.wolfcode.wolf2w.controller;

import cn.wolfcode.wolf2w.domain.Thee;
import cn.wolfcode.wolf2w.service.IDestinationService;
import cn.wolfcode.wolf2w.service.IRegionService;
import cn.wolfcode.wolf2w.service.ITheeService;
import cn.wolfcode.wolf2w.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/thee")
public class TheeController {
  @Autowired
  private ITheeService theeService;


    @GetMapping("/list")
    public Object list(){
        List<Thee> all = theeService.findAll();
        return JsonResult.success(all);
    }

    @GetMapping("/one")
    public Object one(String id){
        Thee byId = theeService.findById(id);
        System.out.println(byId);
        return JsonResult.success(byId);
    }
}
